qui(
    function (require, exports, module) {
        VODNew.Action = (function () {

            var editMergeForm = null;

            function initWindowEvent() {
                window.onbeforeunload = function () {
                    var warning = "确认要重新打点吗？";
                    return warning;
                }
                $(window).unbind("keydown").bind("keydown", function (e) {
                    return  VODNew.Evt.globalEvent(e);
                });
                window.onresize = function () {
                    VODNew.Util.browserZoomTips();
                    VODNew.Util.LayoutInit();
                    //  VODNew.Util.doNewsGridResize();
                };
            }

            var editMergeRun = function () {
                var mainFunc = function(){
                    if (editMergeForm == null) {
                        editMergeForm = new VODNew.EditMerge($.extend(true, {
                            $FrameGrid: $('#frame_list'),
                            $AdvertGrid: $('#advert_list'),
                            $NewsGrid: $('#news_list'),
                            $NewsSubmitGrid: $('#auto_submit_list'),
                            $NewsDelGrid: $('#auto_del_list'),
                            $MaskGrid: $('#mask_list')
                            //     $FragmentGrid:$('#fragment_list')
                            // '$form': $('form[role=form]')
                        }, {}));
                        setTimeout(function () {
                            $("body footer").hide();
                            console.log("隐藏footer");
                        }, 2000)
                        editMergeForm.init();
                        initWindowEvent();
                    }
                }

                mainFunc();

//                EpgWeb.Dao.checkJSVersion([{name: "VODNew"}], function (data) {
//                    var versionCheck = false;
//                    if (data != null && data.code == "A00000") {
//                        versionCheck = data.version == VODNew.version;
//                    }
//                    if (versionCheck) {
//                        mainFunc();
//                    } else {
//                        SystemDialog.queryConfirm("页面过时，请重新刷新!", function (flag) {
//                            window.location.reload(true)
//                        });
//                    }
//                })
            }
            return {
                editMergeRun: editMergeRun
            }
        })();
    }
);